#/bin/bash

clear

MODULE_NAME="mykprobe"

make

lsmod_res="$(lsmod | grep ${MODULE_NAME})"
if [ -n "${lsmod_res}" ]
then
    rmmod "${MODULE_NAME}"
fi
dmesg -c > /dev/null 2>&1
insmod "${MODULE_NAME}.ko"
exit 0

# write_file="/mnt/xfs/a.txt"
# /root/StudyLinux/file/test_write "${write_file}" "${1}"

# echo 1 > /sys/block/sdb/device/delete
# echo "- - -" > /sys/class/scsi_host/host0/scan
# echo "- - -" > /sys/class/scsi_host/host1/scan
# echo "- - -" > /sys/class/scsi_host/host2/scan

# rmmod "${MODULE_NAME}"
echo "------------------------------------------------"
echo "dmesg"
dmesg
echo "------------------------------------------------"
echo "file"
cat "${write_file}"
echo ""
echo "------------------------------------------------"

# make clean
